
  War of the Lions Tweak v2.52 - Modding Readme:

    This document contains instructions for modding the mod! If you aren't interested in modding and only want
    to _play_ it, then this document isn't for you - you can safely delete it along with the Source folder.
    For those of you looking to mod it, read on!


**************************************************************************************************************

  Contents of this document:

    Step 0.) Source folder contents
    Step 1.) FFTPatcher setup
    Step 2.) Valhalla setup
    Step 3.) Make whatever changes you want
    Step 4.) Compiling the game


**************************************************************************************************************

  Step 0.) Source folder contents


  - FFTPatcher (folder):
        This folder contains the WOTL Tweak specific files for FFTPatcher:

    * wotltweakv2.52.fftpatch:
        The War of the Lions Tweak fftpatch file, containing all data changes.

    * wotltweakv2.52_plus_encounter_unscaling.fftpatch:
        The alternate fftpatch file that also includes the removal of enemy level scaling in random battles
        (by manually assigning levels to all enemies in the ENTD tab). Aside from the ENTD tab, it's identical
        to wotltweakv2.52.fftpatch.

        Yes, I maintain both these patches while working on the mod, which means I make every change twice.
        If you're only interested in one of these patches, feel free to delete the other. Maybe in a future
        release I will find a way to do Encounter Unscaling with ASM, meaning I won't need to maintain two
        patches anymore.

    * resources.zip:
        This file tells FFTPatcher the names and formulas of all the items, abilities, etc. for display
        purposes. It has been updated with the WOTL Tweak changes.

  - Valhalla (folder):
        This folder contains several Valhalla source files for the text, event, and ASM changes included in
        this mod. It also includes one python file that contains a change to Valhalla itself, which was
        necessary for changing the spell quote formatting.


**************************************************************************************************************

  Step 1.) FFTPatcher setup


    FFTPatcher was used for all the data changes in this mod. Though Valhalla is capable of modifying this
    data, FFTPatcher has a far more user-friendly interface.

    1.) Go to https://ffhacktics.com/wiki/FFTPatcher and download FFTPatcher.
        Version 0.492 was used for this mod, but versions after that will probably work just fine.

    2.) Extract the contents to a new "FFTPatcher" folder somewhere on your computer.

    3.) Put the two fftpatch files from this archive in or near that folder.

    4.) Drag and drop my resources.zip file (from this archive) into your FFTPatcher folder (if there's
        already one there, replace it).

    You're now ready to use FFTPatcher!


**************************************************************************************************************

  Step 2.) Valhalla setup


    Valhalla was used for text, events, ASM, and data that's not in FFTPatcher. Unlike FFTPatcher, it is *not*
    user-friendly. And even if you don't intend to change anything with it, you will still need to use it to
    compile the ISO after using FFTPatcher. In a future version of this mod I intend to move on from this
    tool, but for this version it was indispensable.

    1.) Go to https://www.romhacking.net/utilities/1478 and download Valhalla.

    2.) Extract the "Valhalla" folder to somewhere on your computer.

    3.) Put a copy of your FFT WOTL ISO inside Valhalla\Data.
        Name it "fft-wotl.iso" (and delete the "replaceme-fft-wotl.iso" file that's already in there).

    4.) Run Valhalla.bat from the Valhalla folder.

    5.) In Valhalla, do "Setup files", "Decode text files", then "Decode EVT".
        This step is extracting the text and event data from your ISO and saving them as files.

    6.) Close Valhalla, then drag and drop the contents of my Valhalla folder (from this archive) into your
        Valhalla installation folder.
        Replace all 15 files when prompted.
        This step is replacing the vanilla text and events with the ones from WOTL Tweak.

    7.) Reopen Valhalla.bat, and do "Encode text files", then "Encode EVT".
        This step is compiling WOTL Tweak's text and events for insertion into the ISO.

    You're now ready to use Valhalla!


**************************************************************************************************************

    Step 3.) Make whatever changes you want


    This section explains how to make each type of edit and how to compile it in Valhalla. Note that your
    changes still aren't _testable_ in your ISO yet - for that you'll want to go down to section 4 (Compiling
    the game).


    DATA:

     1.) To modify data, open FFTPatcher.

     2.) Open your desired fftpatch file (or both of them if you are planning on maintaining them both - you
         can open two instances of FFTPatcher and work on them both at the same time).

     3.) Muck around with the various tabs and edit whatever your heart desires.

     4.) Save the fftpatch file when done.

     5.) Do "PSP -> Patch War of the Lions ISO..." and select your fft-wotl.iso (NOT fft-wotl-patched.iso, if
         it exists) from your Valhalla setup (in Valhalla\Data). Do NOT check "Apply Slowdown Fix" - WOTL
         Tweak already does this in ASM, and it may not be compatible with this new checkbox.

     6.) Click "OK" to patch it!


    TEXT:

     1.) Navigate to Valhalla\Data\patches\files.

     2.) Here you'll find a bunch of arcane-looking folders with even more arcane-looking files inside.
         Believe it or not, these are your text files, which you can edit in your favorite text editor
         (I use Notepad++). You want to edit the ones that end in "utt" (NOT "unt").
         Here's the list of files WOTL Tweak edits:

        * rest-mes\rest-mes-1-utt
          Contains item/job/ability names, errors, labels, other short strings.

        * rest-mes\rest-mes-2-utt
          Contains item/job/ability descriptions and other long strings.

        * spell-mes\spell-mes-0-utt.txt
          Contains the spell quotes. Make sure to test each quote after changing it, because this part of the
          game is very fragile. If your quote is broken (if it won't come up), then tweak a word or two to
          change its length and try again. The ASM section below explains how you can set your spell quotes to
          trigger 100% of the time for testing.

        * tuto-mes\tuto-mes-2-utt
        * tuto-mes\tuto-mes-3-utt
        * tuto-mes\tuto-mes-5-utt
        * tuto-mes\tuto-mes-6-utt
          Contain various tutorial-related strings.

        * wld-mes\wld-mes-0-utt
          Contains "world text", such as story descriptions, rumors, chronicle entries, etc.

     3.) After changing text as desired in Notepad++ or some other text editor, save your files and open
         Valhalla.bat

     4.) In Valhalla, do "Encode text files" to compile the text changes.
         Be careful NOT to click "Decode text files", as this will cause Valhalla to decompile the ISO and
         overwrite the text files, stomping all your hard work. This is a classic Valhalla "gotcha".


    EVENTS:

     1.) Navigate to Valhalla\Data\patches\files\test-evt.

     2.) Open test-evt-unt in your favorite text editor (yes, this time you want the "unt" file).

     3.) After changing events as desired in Notepad++ or some other text editor, save your file and open
         Valhalla.bat

     4.) In Valhalla, do "Encode EVT" to compile the event changes.
         Be careful NOT to click "Decode EVT", as this will cause Valhalla to decompile the ISO and overwrite
         the events file, stomping all your hard work. This is a classic Valhalla "gotcha".


    ASM:

     1.) Navigate to Valhalla\Data\patches. 

     2.) You'll see a list of ASM files. These files specify offsets to write ASM code to, as well as the ASM
         to write. The tzepish-hacks.asm file in particular contains all the ASM I wrote for WOTL Tweak (but
         I also use ASM hacks from the other files).

     3.) Modify the ASM however you like, assuming you know what you're doing.

     4.) The blacklist.asm file can be used to turn individual ASM hacks on or off. For example, you may want
         to enable "Spell quotes always play" if you are testing spell quotes. The ASMs for the optional
         features can also be turned on in here (they are turned off by default).

     5.) There is no "Encode ASM" button like there is for text and events - the ASM will be compiled into the
         game in the next step.


**************************************************************************************************************

    Step 4.) Compiling the game


    Okay, you've made your changes and you're ready to compile the game. Let's do it!

     1.) Use FFTPatcher to patch fft-wotl.iso as described above in the DATA section (if you already did this
         earlier, you can skip this step. The important thing is that the fft-wotl.iso file is *not* a copy of
         the vanilla game - it needs the fftpatch data).

     2.) Open Valhalla.bat and do "Setup files", then "Apply patches". This will create a file called
         fft-wotl-patched.iso and then write the ASM, compiled text, and compiled events to it.

     3.) You're done! fft-wotl-patched.iso is your modified ISO.


    So to summarize:

     * Make sure fft-wotl.iso is up to date with your FFTPatcher changes.
     * Use "Encode text files" / "Encode EVT" whenever you change text / events (avoid the "Decode" buttons).
     * The final step is always "Setup files" then "Apply patches" to spit out a new fft-wotl-patched.iso file
       with all your changes in it.


**************************************************************************************************************

    --  (C) 2021 - 2023  Tzepish (Blaine Higdon)
